package com.xiaomili.halfsugar.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/7/15.
 */
public class FragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> mData;

    public FragmentAdapter(FragmentManager fm, List<Fragment> datas) {
        super(fm);
        this.mData = datas;
    }

    @Override
    public Fragment getItem(int position) {
        return mData.get(position);
    }

    @Override
    public int getCount() {
        return mData == null ? 0 : mData.size();
    }
}
